<template>
	<view class="shop">
		<image class="img_background" src="@/static/images/shop_background.png" mode=""></image>
		<view class="operator-top" v-if="user_info.agency_type != 0">
			<view class="operator-conent">
				<view class="operator-title">
					<view class="operator-title-text">运营商管理</view>
					<u-icon  @click="txtNavBtn(4)" class="operator-setting" name="setting-fill"></u-icon>
				</view>
				<view class="operator-nav">
					<view class="operator-conent-left">
						<view class="operator-num-title">
							{{getTimeState()}}  {{user_info.nickname}}
						</view>
						<view class="operator-num">
							<u-icon style="margin-right: 10rpx;" name="file-text-fill"></u-icon>
							<text>{{user_info.levelname}}</text>
						</view>
					</view>
					<view class="operator-conent-right">
						<!-- <view class="end-time">
							<u-icon style="margin-right: 10rpx;" name="clock-fill"></u-icon>
							<u-count-down :timestamp="timestamp" show-days separator="zh"></u-count-down>
						</view> -->
						<view class="operator-num-title">今天是您</view>
						<view class="operator-num">
							<text style="font-size: 26rpx; margin-right: 10rpx;">工作的</text>
							<text>{{user_info.maxsuccessions}}天</text>
						</view>
					</view>
				</view>
			</view>
			
			<view class="operator-card">
				<view class="balance-nav">
					<view class="balance">
						<view class="balance-title">可提现余额</view>
						<view class="balance-num">{{user_info.money}}</view>
					</view>
					<view class="right-btn" @click="txtNavBtn(3)">去提现</view>
				</view>
				
				
				<view class="balance-list">
					<view class="balance-item">
						<view class="item-name" @click="handelPrompt('accredit_money')">
							保证金
							<u-icon name="question-circle-fill" style="margin-left: 2rpx;"></u-icon>
						</view>
						<view class="item-num">{{user_info.accredit_money}}</view>
					</view>
					<view class="balance-item">
						<view class="item-name" @click="handelPrompt('margin_money')">
							本月推广收入
							<u-icon name="question-circle-fill" style="margin-left: 2rpx;"></u-icon>
						</view>
						<view class="item-num">{{user_info.margin_money}}</view>
					</view>
					<view class="balance-item">
						<view class="item-name" @click="handelPrompt('month_money')">
							本月运营收入
							<u-icon name="question-circle-fill" style="margin-left: 2rpx;"></u-icon>
						</view>
						<view class="item-num">{{user_info.month_money}}</view>
					</view>
					<view class="balance-item" @click="txtNavBtn(3)">
						<view class="item-name">
							已提现
						</view>
						<view class="item-num">{{user_info.withdraw_money}}</view>
					</view>
				</view>
			</view>
			
			<view class="time-nav">
				<view class="time-nav-title">
					<view v-if='user_info.order_num>0'>本时段您的辖区</view>
					<view v-if='user_info.order_num>0'>还需完成{{user_info.order_num}}单</view>
					<view v-if="user_info.order_num == 0 && user_info.agency_type == 1">恭喜您提前完成本阶段合作指标</view>
					<u-icon v-if="user_info.is_tan == 2" @click="handelPrompt('examine_time')" color="#df5b1e" style="margin-left: 10rpx;" name="question-circle-fill"></u-icon>
				</view>
				<view class="end-time" v-if="user_info.examine_time">
					
					<view style="text-align: right;" v-if="user_info.order_num != 0">本时段考核剩余</view>
					<view style="text-align: right;" v-else>距下次考核还剩</view>
					<!-- <u-icon style="margin-right: 10rpx;" name="clock-fill"></u-icon> -->
					<u-count-down :timestamp="user_info.examine_time" show-days separator="zh"></u-count-down>
				</view>
			</view>
		</view>
		
		
		<view class="shop_main" :style="[style]" v-show="is_dl">
			<view class="main_info" v-if="user_info.agency_type == 0">
				<image :src="user_info.avatar" mode="aspectFill" @click="txtNavBtn(4)"></image>
				<view class="info">
					<view class="name one-txt-cut">{{user_info.nickname}}
						<view class="txt">{{user_info.levelname}}</view>
					</view>
					<view class="txt">{{user_info.mobile}}</view>
				</view>
				<u-button shape="circle" class="apply-operator" @click="applyOperator">申请运营商</u-button>
			</view>
			<!--  -->
			<!-- 			<view class="up_text" @click="mainStoreBtn">
				<image src="@/static/images/shop_img1.png" mode=""></image>
				<view class="text">
					<view class="txt">个人信息</view>
					<u-icon name="arrow-right" color="#BEBEBE" size="28"></u-icon>
				</view>
			</view> -->
			<!--  -->
			<view class="num_list" v-show="is_dl" v-if="user_info.agency_type == 0">


				<view class="list">
					<!-- <image src="@/static/images/txt_icon1.png" mode=""></image> -->
					<view class="t_name">{{user_info.team_money}}</view>
					<view class="t_tip">团队贡献</view>
				</view>
				<view class="list">
					<!-- <image src="@/static/images/txt_icon6.png" mode=""></image> -->
					<view class="t_name">{{user_info.zhi_money}}</view>
					<view class="t_tip">直推赚佣</view>

				</view>

				<view class="list" @click="txtNavBtn(3)">
					<view class="t_name">{{user_info.withdraw_money}}</view>
					<view class="t_tip">已提现</view>
				</view>
				<view class="list" @click="txtNavBtn(3)">
					<view class="t_name">{{user_info.money}}</view>
					<view class="t_tip">去提现</view>
				</view>

			</view>
			<view class="txt_list">
				<!-- <view class="list" @click="txtNavBtn(1)">
					<image src="@/static/images/txt_icon1.png" mode=""></image>
					<text>推广产品</text>
				</view>
				
				<view class="list" @click="txtNavBtn(3)">
					<image src="@/static/images/txt_icon3.png" mode=""></image>
					<text>我的钱包</text>
				</view>
				<view class="list" @click="txtNavBtn(4)">
					<image src="@/static/images/txt_icon4.png" mode=""></image>
					<text>个人资料</text>
				</view>
				<view class="list" @click="txtNavBtn(5)">
					<image src="@/static/images/txt_icon5.png" mode=""></image>
					<text>修改密码</text>
				</view> -->
				<!-- <view class="list" @click="txtNavBtn(3)">
					<image src="@/static/images/txt_icon3.png" mode=""></image>
					<text>我的钱包</text>
				</view> -->
				<view class="list" @click="txtNavBtn(6)">
					<image src="@/static/images/info_icon1.png" mode=""></image>
					<view class="t_tip">商务合作</view>
				</view>
				<view class="list" @click="txtNavBtn(5)">
					<image src="@/static/images/left_icon3.png" mode=""></image>
					<view class="t_tip">修改密码</view>

				</view>
				
				<view class="list" @click="txtNavBtn(4)">
					<image src="@/static/images/left_icon8.png" mode=""></image>
					<view class="t_tip">个人资料</view>
				</view>


				<view class="list" @click="defineBtn">
					<image src="@/static/images/left_icon6.png" mode=""></image>
					<view class="t_tip">退出登录</view>
				</view>
				<!-- <view class="list" @click="txtNavBtn(7)">
					<image src="@/static/images/txt_icon7.png" mode=""></image>
					<text>二维码</text>
				</view>
				<view class="list" @click="txtNavBtn(8)">
					<image src="@/static/images/txt_icon8.png" mode=""></image>
					<text>分享推广</text>
				</view>
				<view class="list" @click="txtNavBtn(9)" v-if="userinfo.level==2 || userinfo.level==3">
					<image src="@/static/images/txt_icon8.png" mode=""></image>
					<text>提现</text>
				</view> -->
			</view>
			<!--  -->

			<!-- <view class="num_list2">
			<view>
				买卖、转借电话卡是犯罪行为
			</view>
			<view>
				严禁恶意销户或诱导用户销户
			</view>
		</view> -->

			<view class="banner">
				<image src="../../static/banner.png" mode="widthFix">
			</view>
			<view class="nav_list" v-if="user_info.agency_type ==0">
				<u-tabs :list="navList" height='88' active-color='#26C281' inactive-color='#222222' :is-scroll="true"
					:current="current" :font-size="28" @change="navChange"></u-tabs>
			</view>
			<view class="nav_list" v-else>
				<u-tabs :list="navListTwo" height='88' active-color='#26C281' inactive-color='#222222' :is-scroll="true"
					:current="current" :font-size="28" @change="navChange"></u-tabs>
			</view>
			
			
						 <view class="search_box">
							 <u-collapse ref="collapseHeight" @change="handleOpenChange">
								<u-collapse-item :title="sousuo">
									<u-form>
										<u-form-item v-if="user_info.agency_type">
											<u-input placeholder="自购订单/辖区订单" type="select" v-model="order_typeText" maxlength="11" border @click="orderTypeShow = true"></u-input>
										</u-form-item>
										<u-form-item>
											<u-input placeholder="请输入订购号码" v-model="phone" maxlength="11" border></u-input>
										</u-form-item>
										<u-form-item>
											<u-input placeholder="请输入姓名" v-model="shipping_contact"  maxlength="40" border></u-input>
										</u-form-item>
										<u-form-item>
											<u-input placeholder="请输入电话" v-model="shipping_phone"  maxlength="11" border></u-input>
										</u-form-item>
										<u-form-item>
											<u-input placeholder="请输入产品名称" v-model="package_name"  maxlength="40" border></u-input>
										</u-form-item>
										<u-form-item>
											<view class="btn_box">
												<u-button shape="circle" type="error" class="btn reset" @click="reset">重置</u-button>
												<u-button shape="circle" class="btn confirm" @click="confirm">查询</u-button>
											</view>
										</u-form-item>
									</u-form>
								</u-collapse-item>
							</u-collapse>
						 </view>
					
			
			

			<view class="order-list">

				<view class="order-item" v-for="(item,index) in list" :key="index">
					<view class="header">
						<text class="pro-title">{{item.packages.user_name}}</text>
						<view class="status a" v-if="item.order_status == 0 && !item.error_msg">已取消</view>
						<view class="status a" v-if="item.order_status == 0 && item.error_msg">结算失败</view>
						<view class="status b" v-if="item.order_status == 1">已激活</view>
						<view class="status c" v-if="item.order_status == 2">待收货</view>
						<view class="status d" v-if="item.order_status == 3">待处理</view>
						<view class="status e" v-if="item.order_status == 4 && item.is_more == 1">待结算</view>
						<view class="status e" v-if="item.order_status == 4 && item.is_more == 2 && !item.error_msg">首月待结算</view>
						<!-- <view class="status g" v-if="item.error_msg">结算失败处理中</view> -->
						<view v-if="item.order_status == 5 && !item.error_msg">
							<view class="status h"  v-if="item.is_more == 1 || item.more_num >1">
								已全部结算
							</view>
							<view class="status e"  v-if="item.is_more == 2 && item.more_num ==1">
								次月待结算
							</view>
							<!-- <view v-if="item.is_more == 2 && item.more_num >1">
								次月已结算
							</view> -->
							</view>
						<view class="status e" v-if="item.order_status == 6 && item.audit_status == 0 && item.baoxiao_status == 0">待上传凭证</view>
						<view class="status e" v-if="item.order_status == 6 && item.audit_status == 1 && item.baoxiao_status == 0">待审核</view>
						<view class="status e" v-if="item.order_status == 6 && item.audit_status == 3 && item.baoxiao_status == 0">报销失败</view>
						<view class="status e" v-if="item.order_status == 6 && item.baoxiao_status == 1 && item.is_more == 1">待报销</view>
						<view class="status e" v-if="item.order_status == 6 && item.baoxiao_status == 1 && item.is_more == 2">首月待报销</view>
						<view v-if="item.order_status == 6 && item.baoxiao_status == 2">
						
							<view class="status h" v-if="item.is_more == 1 || item.more_num >1">
								已全部报销
							</view>
							<view class="status e"  v-if="item.is_more == 2 && item.more_num ==1">
								次月待报销
							</view>
							<!-- <view v-if="item.is_more == 2 && item.more_num >1">
								报销完成
							</view> -->
						</view>
					</view>
					<view class="main">
						<view class="cell" @click.stop="copyBtn(item.order_id)"><text>订单编号：{{item.order_id}}</text></view>
						<view class="cell"><text>{{item.shipping_contact}}</text><text>{{item.shipping_idcard}}</text></view>
						<view class="cell" @click.stop="copyBtn(item.phone)"><text>订购号码：{{item.phone}}</text></view>
						<view class="cell"><text>联系地址：{{item.shipping_province}}{{item.shipping_city}}{{item.shipping_area}}{{item.shipping_address}}</text></view>
						<view class="cell" @click.stop="copyBtn(item.shipping_phone)"><text>联系电话：{{item.shipping_phone}}</text></view>
						<view class="cell" ><text>下单时间：{{item.createtime_text}}</text></view>
						<view class="cell" v-if="item.chong_phone" @click.stop="copyBtn(item.chong_phone)"><text>充值号码：{{item.chong_phone}}</text></view>
						<view class="cell" style="display: flex; align-items: center;">
							<text v-if="item.baoxiao_status == 0 && item.audit_status == 0 && item.packages.card_type == 1" style="color: #26c281;">请上传结算审核信息：</text>
							<text v-if="item.baoxiao_status == 0 && item.audit_status == 0 && item.packages.card_type == 2" style="color: red;">请提交号码或充值二维码：</text>
							<text v-if="item.image_text">充值截图：</text>
							<text v-if="item.audit_status == 3">因{{item.reason}}原因审核未通过，请重新提交：</text>
							<image v-if="item.image_text && item.audit_status != 3" style="width: 90rpx; height: 90rpx;" :src="item.image_text" @click="previewImage(item.image_text)"></image>
							<text v-if="item.admin_image_text">充值凭证：</text>
							<image v-if="item.admin_image_text" style="width: 90rpx; height: 90rpx;" :src="item.admin_image_text" @click="previewImage(item.admin_image_text)"></image>
							
							<!-- <u-upload 
								v-if="item.packages.card_type != 1 && item.audit_status == 0 || item.audit_status == 3"
								:show-upload-list="false"
								:action="action" 
								:header="header" 
								custom-btn @on-success="(e) => onSuccess(e, item)">
								<view slot="addBtn" class="upload-btn" hover-stay-time="150" style="color: red;">上传截图</view>
							</u-upload> -->
							
							<text class="cell" v-if="item.audit_status == 0 || item.audit_status == 3" style="color: red;" @click="uploadBtn(item.id,item.packages.pay_channel,item.phone,item.image_text,item.image,item.call_image_text,item.call_image)">上传截图</text>
							
						</view>
						<view class="cell" style="display: flex; align-items: center;">
							<text v-if="item.call_image_text && item.audit_status != 3">通话记录：</text>
							<image v-if="item.call_image_text  && item.audit_status != 3" style="width: 90rpx; height: 90rpx;" :src="item.call_image_text" @click="previewImage(item.call_image_text)"></image>			
						
						</view>
					</view>
					<view class="footer" v-if="item.order_status == 0">
						<text class="left" >失败原因:{{item.remark}}</text>
					</view>
						
					<view class="footer" v-if="item.baoxiao_msg_one_text && item.order_status == 6">
						<text class="left" >{{item.baoxiao_msg_one_text}}</text>
					</view>
					<view class="footer" v-if="item.baoxiao_msg_text && item.order_status == 6">
						<text class="left" >{{item.baoxiao_msg_text}}</text>
					</view>
					
					
					<view class="footer" v-if="item.order_status == 1">
						<text class="left" v-if="item.order_status == 2">{{item.shipping_company_name}}</text>
						<text class="right" v-if="item.order_status == 2">{{item.shipping_no}}</text>
						<!-- <text class="right" v-if="item.order_status == 3">下单时间：{{item.createtime_text}}</text> -->
					</view>
					
					<view class="footer" v-if="item.order_status == 2">
						<text class="left" v-if="item.order_status == 2">{{item.shipping_company_name}}</text>
						<text class="right" v-if="item.order_status == 2">{{item.shipping_no}}</text>
						<!-- <text class="right" v-if="item.order_status == 3">下单时间：{{item.createtime_text}}</text> -->
					</view>
					<view class="footer" v-if="item.jiesuan_time_one">
						<text class="right">{{item.jiesuan_time_one}}</text>
					</view>
					<view class="footer" v-if="item.jiesuan_time_text_two">
						<text class="right">{{item.jiesuan_time_text_two}}</text>
					</view>
					<view class="footer" v-if="item.error_msg && item.audit_status ==0 || item.audit_status ==3 " style="color: #004eff;">
						<text class="left" >{{item.error_msg}}</text>
					</view>
					
					<view class="footer" v-if="item.rebate_recover_msg">
						<!-- <text class="left" v-if="item.order_status == 5">佣金:{{item.user_rebate}}</text> -->
						<!-- <text class="right" v-if="item.order_status == 5">{{item.settlement_time_text}}</text> -->
						<text class="left" v-if="item.rebate_recover_msg">追回原因:{{item.rebate_recover_msg}}</text>
						<text class="right" v-if="item.rebate_recover_money">追回金额:{{item.rebate_recover_money}}</text>
					</view>
					
				</view>

			</view>
		</view>
		<u-popup v-model="promptShow" mode="center" border-radius="16" width="590rpx" height="600rpx">
			<view class="gy-center-title">提示</view>
			<scroll-view :scroll-y="true" class="gy-center goods-tz-content">
				{{prompts[promptType]}}
			</scroll-view>
			<view v-if="promptType === 'examine_time'" class="gy-bottom examine-time" @click="promptShow = false">
				<view @click="applyOperator">重新申请</view>
				<view>关闭</view>
			</view>
			<view v-else class="gy-bottom" @click="promptShow = false">关闭</view>
		</u-popup>
		<!-- 温馨提示 -->
		<u-popup v-model="show" mode="center" border-radius="16" width="590rpx" height="400rpx">
			<view class="shop_box">
				<view class="title">温馨提示</view>
				<view class="text" v-if="type==1">您的团队成员人数不符合升级要求，暂时不能申请！</view>
				<view class="text" v-if="type==2">您没有权限使用，只有店长、副店长、管理员才可以使用！</view>
				<view class="text" v-if="type==3">申请已提交，请耐心等待审核！</view>
				<view class="btn">
					<text class="btn_right" @click="show=false">确定</text>
				</view>
			</view>
		</u-popup>
		
		<!-- 推广有奖 -->
		<u-popup v-model="tuiShow" mode="center" border-radius="16" width="590rpx" height="600rpx">
			<view class="gy-center-title">{{tuiList[0].title}}</view>
			<scroll-view :scroll-y="true" class="gy-center goods-tz-content"> 
				<u-parse class="gy-center-p" :html="tuiList[0].content"></u-parse>
			</scroll-view>
			<view class="gy-bottom tui-bottom">
				<view class="bottom-btn" style="color: #666;" @click="tuiShow = false">我知道了</view>
			</view>
		</u-popup>
		
		<u-popup v-model="tuiShow2" mode="center" border-radius="16" width="590rpx" height="600rpx">
			<view class="gy-center-title">{{tuiList[1].title}}</view>
			<scroll-view :scroll-y="true" class="gy-center goods-tz-content"> 
				<u-parse class="gy-center-p" :html="tuiList[1].content"></u-parse>
			</scroll-view>
			<view class="gy-bottom tui-bottom">
				<view class="bottom-btn" style="color: #666;" @click="tuiShow2 = false">我知道了</view>
			</view>
		</u-popup>
		<u-popup v-model="tuiShow3" mode="center" border-radius="16" width="590rpx" height="600rpx">
			<view class="gy-center-title">{{tuiList[2].title}}</view>
			<scroll-view :scroll-y="true" class="gy-center goods-tz-content"> 
				<u-parse class="gy-center-p" :html="tuiList[2].content"></u-parse>
			</scroll-view>
			<view class="gy-bottom tui-bottom">
				<view class="bottom-btn" style="color: #666;" @click="tuiShow3 = false">我知道了</view>
			</view>
		</u-popup>
		
		<!-- 上传图片 -->
		<u-popup v-model="uploadShow" mode="center" border-radius="16" width="590rpx" height="400rpx">
			
		</u-popup>
		<UploadPayment ref="upPayment" @submit='submitBtn'></UploadPayment>
		<u-action-sheet :list="orderTypeSheetList" v-model="orderTypeShow" @click="orderTypeCallback"></u-action-sheet>
	</view>
</template>

<script>
	import baseVal from '@/config/base.js'
	import PayInfo from '@/components/pay_info/pay_info.vue';
	import UploadPayment from '@/components/upload_payment/upload_payment.vue';
	import ConfirmReceipt from '@/components/confirm_receipt/confirm_receipt.vue';
	// 区分开发环境和生产环境  接口地址
	let baseUrl;
	if (process.env.NODE_ENV === 'development') {
		baseUrl = baseVal.devUrl // 开发环境
	} else {
		baseUrl = baseVal.baseUrl // 生产环境
	}
	import {
		mapState
	} from 'vuex';
	export default {
		components:{
			PayInfo,UploadPayment,ConfirmReceipt
		},
		data() {
			return {
				timestamp: 864000,
				header: {
					token: uni.getStorageSync('token')
				},
				action: baseUrl + '/api/Common/upload',
				uploadShow: false,
				uploadData: {},
				topNumber: 0,
				// 
				tuiList: [
					{title: '保证金', rightText: '', content: '222'},
					{title: '本月推广收入', rightText: '', content: ''},
					{title: '本月运营收入', rightText: '', content: ''},
					// {title: '提示', rightText: '确定', content: ''},
				],
				tuiShow: false,
				tuiShow2:false,
				tuiShow3:false,
				is_dl: true,
				navList: [
					{
						name: '全部'
					},
					{
						name: '待处理'
					},
					{
						name: '待收货'
					}, 
					{
						name: '待充值'
					}, 
					{
						name: '佣金结算'
					}, {
						name: '话费报销'
					},
					{
						name: '失败'
					}
				],
				navListTwo: [
					{
						name: '全部'
					},
					{
						name: '待处理'
					},
					{
						name: '待收货'
					}, 
					{
						name: '待充值'
					}, 
					{
						name: '佣金结算'
					}, 
					{
						name: '话费报销'
					},
					{
						name: '失败'
					},
					{
						name: '运营奖励'
					},
				],
				sousuo:"搜索",
				current: 0,
				shop_name: '--',
				ljsy: '--',
				score: "--",
				commission: '--',
				morning: 2,
				morning_time: '--',
				afternoon: 2,
				afternoon_time: '--',
				ljmhe: '',
				sell_num: '',
				ljxf_score: '',
				lscs: '',
				current2: -1,
				// 弹框
				type: 1,
				show: false,
				user_info: {},
				spread: '',
				page: 1,
				list: [],
				package_name: "",
				shipping_phone: "",
				shipping_contact: "",
				phone: "",
				order_type: '',
				order_typeText: '',
				orderTypeShow: false,
				orderTypeSheetList: [
					{value: 1, text: '自购订单'},
					{value: 2, text: '辖区订单'},
				],
				prompts: {
					'accredit_money': '保证金222',
					'margin_money': '本月推广收入',
					'month_money': '本月运营收入',
					'examine_time': '',
				},
				promptShow: null,
				promptType: null,
			};
		},
		computed: {
			...mapState({
				userinfo: state => state.userinfo
			}),
			style() {
				return {
					paddingTop: this.topNumber + 10 + 'px',
				}
			}
		},
		onLoad(opt) {
			// 获取状态栏高度
			uni.getSystemInfo({
				success: (res) => {
					this.topNumber = res.statusBarHeight
				}
			});
			console.log(opt.ids);
			this.page = 1
			this.getList()
		},
		onShow() {
			this.shopInfo()
		},
		onHide() {
			this.show = false
		},
		methods: {
			// 从新计算折叠版高度
			handleOpenChange() {
				this.$nextTick(() => {
					this.$refs.collapseHeight.init()
				})
			},
			orderTypeCallback(index) {
				this.order_type = this.orderTypeSheetList[index].value;
				this.order_typeText = this.orderTypeSheetList[index].text;
			},
			handelPrompt(type) {
				if(type == 'accredit_money'){
					this.tuiShow = true;
					this.tuiList[0].content = this.prompts.accredit_money;
				}else if(type == 'margin_money'){
					this.tuiShow2 = true;
					this.tuiList[1].content = this.prompts.margin_money;
				}else{
					this.tuiShow3 = true;
					this.tuiList[2].content = this.prompts.month_money;
				}
			},
			getTimeState() {
				// 获取当前时间
				let timeNow = new Date();
				// 获取当前小时
				let hours = timeNow.getHours();
				// 设置默认文字
				let state = ``;
				// 判断当前时间段
				if (hours >= 0 && hours <= 10) {
					state = `早上好!`;
				} else if (hours > 10 && hours <= 14) {
					state = `中午好!`;
				} else if (hours > 14 && hours <= 18) {
					state = `下午好!`;
				} else if (hours > 18 && hours <= 24) {
					state = `晚上好!`;
				}
				return state;
			},
			goWithdrawal() {
				uni.navigateTo({
					url:'/pages/shop/withdrawal'
				})
			},
			applyOperator() {
				uni.navigateTo({
					url:'/pages/order/apply-operator'
				})
			},
			previewImage(src) {
				uni.previewImage({
					current: 0,
					urls: [src]
				})
			},
			onSuccess(e, item) {
				if(e.code == 1) {
					this.$httpApi.Orderimage({order_id: item.id, image: e.data.url}).then(res=> {
						if (res.code == 1) {
							// item.image = e.data.fullurl
							this.$set(item, 'image_text', e.data.fullurl)
							uni.showToast({
								icon: 'none',
								title: '上传成功'
							});
						}
					})
				}
			},
			reset () {
				this.page = 1
				this.current2 = -1
				this.shipping_contact =""
				this.shipping_phone =""
				this.package_name = ""
				this.phone = ""
				this.order_type = ""
			},
			
			confirm() {
				this.page = 1 
				this.getList()
			},
			copyBtn(txt) {
			
				uni.setClipboardData({
					data: txt,
					success: function() {
						console.log('success');
					}
				});
			},
			navChange(index) {
				if(this.user_info.agency_type !=0){
					if (this.navListTwo[index]['name'] == '全部') {
						this.current2 = -1
					}else if (this.navListTwo[index]['name'] == '待处理') {
						this.current2 = 3
					} else if (this.navListTwo[index]['name'] == '待收货') {
						this.current2 = 2
					} else if (this.navListTwo[index]['name'] == '待充值') {
						this.current2 = 1
					} else if (this.navListTwo[index]['name'] == '佣金结算') {
						this.current2 = 4
					} else if(this.navListTwo[index]['name'] == '话费报销'){
						this.current2 = 6
					} else if (this.navListTwo[index]['name'] == '失败') {
						this.current2 = 0
					}else if (this.navListTwo[index]['name'] == '运营奖励') {
						this.current2 = 5
					}
				}else{
					if (this.navList[index]['name'] == '全部') {
						this.current2 = -1
					}else if (this.navList[index]['name'] == '待处理') {
						this.current2 = 3
					} else if (this.navList[index]['name'] == '待收货') {
						this.current2 = 2
					} else if (this.navList[index]['name'] == '待充值') {
						this.current2 = 1
					} else if (this.navList[index]['name'] == '佣金结算') {
						this.current2 = 4
					} else if(this.navList[index]['name'] == '话费报销'){
						this.current2 = 6
					} else if (this.navList[index]['name'] == '失败') {
						this.current2 = 0
					}
				}
				
				this.current = index;
				this.page = 1
				this.getList()
			},
			// 获取用户信息
			shopInfo() {
				var that = this
				that.$tips.showLoading('加载中')
				that.$httpApi.userShop().then((res) => {
					that.$tips.hideLoading()
					if (res.code == 1) {
						that.prompts.accredit_money = res.data.userinfo.bzj_content
						that.prompts.margin_money = res.data.userinfo.tuiguang_content
						that.prompts.month_money = res.data.userinfo.byyunying_content
						that.user_info = res.data.userinfo;
						that.spread = res.data.spread
						// 区县
						// if(that.user_info.agency_type !=0){
							// that.navList.push({name: '运营奖励'});
						// }
						if(that.user_info.examine_time < 0) {
							that.promptShow = true
							that.promptType = "examine_time"
							that.prompts.examine_time = '您没有完成本时段考核任务，运营商资格取消，您可重新申请。'
							// that.promptType = '您没有完成本时段考核任务，运营商资格取消，您可重新申请。'
						}
						// // 小区
						// if(that.user_info.agency_type == 1) {
						// 	that.prompts.examine_time = "由于您未完成合作约定标准，运营商资格被释放，保证金不予退还。"
						// }
					}
				})
			},
			// 列表
			getList() {
				let { shipping_contact,shipping_phone,package_name,page, current2, phone, order_type } = this 
				var that = this
				if (that.page == 1) {
					that.$tips.showLoading('加载中')
				} else {
					that.status = 'loading'
				}
				var params = {
					page,
					status:current2,
					shipping_contact,
					shipping_phone,
					package_name,
					phone,
					order_type,
				}
				that.$httpApi.userOrderList(params).then((res) => {
					if (res.code == 1) {
						if (that.page == 1) {
							that.list = []
							that.$tips.hideLoading()
						}
						if (res.data.current_page == res.data.last_page) {
							that.status = 'nomore'
						} else {
							that.status = 'loadmore'
						}
						that.list = that.list.concat(res.data.data)
						that.sousuo = '';
						that.sousuo = "搜索" + res.data.total;
					}
				})
			},
			// 编辑个人信息
			mainStoreBtn() {

				uni.navigateTo({
					url: '/pages/person/person_bankcard_revise'
				})
			},
			// 退出登录确定
			defineBtn() {
				this.show = false
				this.$store.commit('SET_TOKEN', '')
				this.$store.commit('SET_INFO', '')
				uni.reLaunch({
					url: '/pages/signIn/sign_in'
				})
			},
			// nav跳转
			navBtn(type) {
				if (type == 2) {
					uni.navigateTo({
						url: '/pages/shop/inv_records'
					})
				}

			},
			// 我的佣金余额
			commissionBalance() {
				if (this.userinfo.level > 1) {
					uni.navigateTo({
						url: '/pages/shop/money_records'
					})
				} else {
					this.type = 2
					this.show = true
				}
			},
			// 
			txtNavBtn(type) {
				if (type == 1) {
					uni.navigateTo({
						url: '/pages/order/ordertwo'
					})
				}
				if (type == 2) {
					uni.navigateTo({
						url: '/pages/shop/inv_records'
					})
				}
				if (type == 3) {
					uni.navigateTo({
						url: '/pages/shop/money_records'
					})
				}
				if (type == 4) {
					uni.navigateTo({
						url: '/pages/person/person_bankcard_revise'
					})
				}
				if (type == 5) {
					uni.navigateTo({
						url: '/pages/person/person_password'
					})
				}
				if (type == 6) {
					uni.navigateTo({
						url:'/pages/other/text?type='+type
					})
				}
				if (type == 7) {
					uni.navigateTo({
						url: '/pages/shop/my_code'
					})
				}
				if (type == 8) {
					this.$tips.showToast('暂未开放')
				}
				if (type == 9) {
					uni.navigateTo({
						url: '/pages/shop/withdrawal_details?money=' + this.commission
					})
				}

			},
			// 上传凭证
			uploadBtn(id,card_type,phone,image_text='',image='',call_image_text='',call_image=''){
				this.$refs.upPayment.openBtn(id,card_type,phone,image_text,image,call_image_text,call_image)
			},
		}
	}
</script>

<style lang="less">
	.examine-time {
		display: flex;
		justify-content: space-evenly;
		align-items: center;
	}
	.gy-center-title {
		padding: 20rpx 0;
		text-align: center;
		font-weight: 700;
		color: #000000;
	}
	.gy-center {
		padding: 0 30rpx;
	}
	.gy-center-p {
		padding-top: 20rpx;
		padding-bottom: 20rpx;
		line-height: 42rpx;
		color: #666;
	}
	.goods-tz-content {
		height: 430rpx;
		overflow-y: auto;
		box-sizing: border-box;
		cursor: pointer;
	}
	.gy-bottom {
		border-top: 1rpx solid #e5e5e5;
		text-align: center;
		padding-top: 25rpx;
		color: #148EFF;
	}
	
	.operator-top {
		position: relative;
		z-index: 2;
		
		.operator-title {
			display: flex;
			text-align: center;
			font-size: 30rpx;
			font-weight: 800;
			padding-bottom: 30rpx;
		}
		.operator-title-text {
			flex: 1;
			padding-left: 40rpx;
		}
		.operator-setting {
			font-size: 40rpx;
		}
		.operator-conent {
			background: linear-gradient(to right, #ef8517, #ec6337);
			padding: 30rpx 30rpx 80rpx 30rpx;
			font-size: 30rpx;
			font-weight: 800;
			color: #fff;
			
			.operator-nav {
				display: flex;
				justify-content: space-between;
			}
			.operator-num-title {
				margin-top: 20rpx;
				font-size: 28rpx;
			}
			.operator-num {
				margin-top: 10rpx;
			}
		}
		
		.time-nav {
			width: 690rpx;
			background-color: #ceffe7;
			border-radius: 20rpx;
			margin: 20rpx auto 0 auto;
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 40rpx 30rpx;
			
			.time-nav-title {
				font-size: 36rpx;
				font-weight: 800;
			}
		}
		
		.end-time {
			
			// ::v-deep {
			// 	.u-countdown-item {
			// 		background: none !important;
					
			// 		.u-countdown-time {
			// 			color: #fff !important;
			// 		}
			// 	}
			// 	.u-countdown-colon {
			// 		color: #fff !important;
			// 	}
			// }
		}
		
		.operator-card {
			width: 690rpx;
			background-color: #fff;
			border-radius: 20rpx;
			margin: -40rpx auto 0 auto;
			padding: 30rpx;
			
			.balance-nav {
				display: flex;
				justify-content: space-between;
				align-items: center;
				
				.balance {
					color: #ec7c28;
					
					.balance-title {
						font-size: 30rpx;
					}
					
					.balance-num {
						font-size: 40rpx;
						font-weight: 800;
					}
				}
				
				.right-btn {
					padding: 10rpx;
					background-color: #ec7c28;
					color: #fff;
					border-radius: 10rpx;
					font-size: 26rpx;
				}
			}
			
			.balance-list {
				margin-top: 30rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				
				.balance-item {
					
					text-align: center;
					
					.item-name {
						font-size: 24rpx;
					}
					
					.item-num {
						font-size: 30rpx;
						font-weight: 800;
					}
				}
			}
		}
	}
	
	.upload-btn {
		width: 150rpx;
		padding: 10rpx 20rpx;
		border: 1rpx solid #eee;
		font-size: 26rpx;
	}
	.banner {
		
		overflow: hidden;
		margin: 30rpx;

		image {
			width: 100%;
			max-width: 100%;
			border-radius: 10rpx;
		}
	}
	
	.search_box {
		width: 100%;
		padding: 0 40rpx;
		.btn_box {
			width: 100%;
			display: flex;
			justify-content: center;
			.btn {
				margin: 10rpx;
				width: 160rpx;
			}
			.confirm {
				background-color: #00afaa;
				color: #fff;
			}
		}
	}
	

	.order-item {
		position: relative;
		padding: 20rpx;
		margin: 20rpx 30rpx;
		background: #fff;
		border-radius: 10rpx;

		.header {
			display: flex;
			justify-content: space-between;
			padding: 20rpx 0;

			.pro-title {
				font-size: 28rpx;
				font-weight: bold
			}

			.status {
				padding: 6rpx 20rpx;
			}

			.a {
				background: #ffd0d1;
				border: #dd0000 1rpx solid;
				border-radius: 6rpx;
				color: #dd0000
			}

			.b {
				background: #cae6ff;
				border: #3480dd 1rpx solid;
				border-radius: 6rpx;
				color: #3480dd
			}

			.c {
				background: #fff6bd;
				border: #ddac2e 1rpx solid;
				border-radius: 6rpx;
				color: #ddac2e
			}

			.d {
				background: #c5ffcc;
				border: #3cc732 1rpx solid;
				border-radius: 6rpx;
				color: #3cc732
			}

			.e {
				background: #ffc4e3;
				border: #ab53dd 1rpx solid;
				border-radius: 6rpx;
				color: #ab53dd
			}

			.f {
				background: #f1f1f1;
				border: #666 1rpx solid;
				border-radius: 6rpx;
				color: #666
			}
			.g {
				background: #f1f1f1;
				border: #666 1rpx solid;
				border-radius: 6rpx;
				color: #0000FF
			}
			.h {
				background: #f1f1f1;
				border: #666 1rpx solid;
				border-radius: 6rpx;
				color: #00FF00
			}
		}

		.main {
			padding: 10rpx 0;

			.cell {
				padding: 5rpx 0;
				color: #666;

				text {
					margin-right: 50rpx;
				}
			}

		}

		.footer {
			padding: 10rpx 0;
			display: flex;
			justify-content: space-between;
			border-top: 1rpx solid #eee;
			margin-top: 10rpx;
			padding-top: 20rpx;
		}

		.footer-b {
			padding: 10rpx 0;
			border-top: 1rpx solid #eee;
			margin-top: 10rpx;
			padding-top: 20rpx;

			.right {
				padding: 10rpx 0;
				text-align: right
			}
		}
	}

	.nav_list {
		margin: 20rpx 30rpx;
		background: #fff;
		border-radius: 10rpx;
		overflow: hidden
	}

	.shop {
		width: 100%;

		.img_background {
			position: absolute;
			top: 0;
			z-index: 1;
			display: block;
			width: 100%;
			height: 870rpx;
		}

		.shop_main {
			position: relative;
			z-index: 2;
			width: 100%;

			.main_info {
				width: 100%;
				padding: 0 40rpx;
				display: flex;

				image {
					display: block;
					width: 124rpx;
					height: 124rpx;
					border-radius: 50%;
				}

				.info {
					flex: 1;
					padding-left: 32rpx;
					display: flex;
					justify-content: space-between;
					flex-direction: column;

					.name {
						font-size: 40rpx;
						font-family: PingFang SC-Bold, PingFang SC;
						font-weight: bold;
						color: #222222;
					}

					.txt {
						font-size: 24rpx;
						font-family: PingFang SC-Regular, PingFang SC;
						font-weight: 400;
						color: #666666;
					}
				}
				
				.apply-operator {
					height: 60rpx;
					background-color: #00afaa;
					color: #fff;
					font-size: 26rpx;
					margin-top: 30rpx;
				}
			}

			.up_text {
				width: 100%;
				height: 165rpx;
				margin-top: 10rpx;
				position: relative;
				overflow: hidden;

				image {
					position: absolute;
					top: 0;
					left: 0;
					z-index: 1;
					display: block;
					width: 100%;
					height: 165rpx;
				}

				.text {
					position: relative;
					z-index: 1;
					width: 100%;
					padding: 65rpx 50rpx;
					display: flex;
					align-items: center;
					justify-content: space-between;

					.txt {
						font-size: 28rpx;
						font-family: PingFang SC-Medium, PingFang SC;
						font-weight: 500;
						color: #222222;
					}
				}
			}

			.num_list2 {
				width: 692rpx;
				padding: 30rpx 20rpx;
				margin: auto;
				background: #fff;
				border-radius: 10rpx;
				line-height: 200%;
				margin-top: 30rpx;
				background: #ceffe7;
			}

			.num_list {
				width: 692rpx;
				padding: 30rpx 20rpx;
				margin: auto;
				background: #fff;
				border-radius: 10rpx;
				display: flex;
				justify-content: space-between;
				flex-wrap: nowrap;
				margin-top: 30rpx;
				background: #ceffe7;

				.list {
					margin-bottom: 16rpx;
					padding-left: 20rpx;
					border-radius: 10rpx;
					display: flex;
					flex-direction: column;
					align-items: center;

					image {
						display: block;
						width: 36rpx;
						height: 36rpx;
					}

					.text {
						padding-left: 15rpx;
						height: 72rpx;
						display: flex;
						justify-content: center;
						flex-direction: column;

						.t_name {
							font-size: 32rpx;
							font-family: OPPOSans-Bold, OPPOSans;
							font-weight: bold;
							color: #222222;
						}

						.t_tip {
							font-size: 24rpx;
							font-family: PingFang SC-Regular, PingFang SC;
							font-weight: 400;
							color: #999999;
						}

						.t_txt {
							font-size: 28rpx;
							font-family: PingFang SC-Regular, PingFang SC;
							font-weight: 400;
							color: #999999;

							text {
								display: block;
							}
						}
					}
				}
			}

			.txt_list {
				width: 692rpx;
				padding: 30rpx 0 1rpx;
				margin: 24rpx auto 0;
				background: #ceffe7;
				border-radius: 10rpx;
				display: flex;
				justify-content: space-between;
				flex-wrap: wrap;

				.list {
					width: 25%;
					margin-bottom: 30rpx;
					display: flex;
					flex-direction: column;
					justify-content: center;
					align-items: center;

					.t_tip {
						margin-top: 10rpx;
					}

					image {
						display: block;
						width: 50rpx;
						height: 50rpx;
						margin: auto;
					}

					text {
						padding-top: 10rpx;
						display: block;
						width: 100%;
						text-align: center;
						font-size: 24rpx;
						font-family: PingFang SC-Regular, PingFang SC;
						font-weight: 400;
						color: #666666;
					}
				}
			}
		}
	}

	.shop_box {
		width: 100%;
		height: 100%;
		padding: 40rpx 0;
		background: red;
		background: linear-gradient(to bottom, rgba(38, 194, 129, 0.20), rgba(38, 194, 129, 0), rgba(38, 194, 129, 0));
		display: flex;
		justify-content: space-between;
		flex-direction: column;

		.title {
			width: 100%;
			font-size: 36rpx;
			text-align: center;
			font-family: PingFang SC-Medium, PingFang SC;
			font-weight: 500;
			color: #222222;
		}

		.text {
			width: 100%;
			padding: 0 40rpx;
			text-align: center;
			font-size: 32rpx;
			font-family: PingFang SC-Medium, PingFang SC;
			font-weight: 500;
			color: #666666;
		}

		.btn {
			width: 100%;
			padding: 0 20rpx;
			display: flex;
			align-items: center;
			justify-content: space-around;

			text {
				display: block;
				width: 540rpx;
				height: 80rpx;
				text-align: center;
				font-size: 32rpx;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				border-radius: 40rpx;
				display: flex;
				align-items: center;
				justify-content: center;
			}

			.btn_left {
				color: #999;
				border: 1px solid #999999;
			}

			.btn_right {
				color: #fff;
				background: #26C281;
			}
		}
	}
</style>